<?php

/**
 * Ctdocumentocaracteristica form.
 *
 * @package    ingenyo-biblio
 * @subpackage form
 * @author     Your name here
 */
class CtdocumentocaracteristicaForm extends BaseCtdocumentocaracteristicaForm
{

  public function configure()
  {
    unset($this['ValorTipificacion'], $this['usuario'], $this['fechaCambio']);
    unset($this['idDocumento']);
            
    $this->setWidget('idIteracion', new sfWidgetFormInputHidden());
    
    $sf_formatter_revisited = new documentoCaracteristicaFormatter($this->getWidgetSchema());
    $this->getWidgetSchema()->addFormFormatter("documentoCaracteristica", $sf_formatter_revisited);
    $this->getWidgetSchema()->setFormFormatterName("documentoCaracteristica");


    $this->setWidget('valorCaracteristica', new sfWidgetFormInputText());
    $this->setWidget('idCaracteristica', new sfWidgetFormInputHidden());
    # $this->setWidget('idDocumento', new sfWidgetFormInputHidden());

    $caracteristica = $this->getObject()->getCtCaracteristica();
    $this->getWidget('idCaracteristica')->setDefault($caracteristica->getId());

    $this->getValidator('valorCaracteristica')->setOption('required', $caracteristica->getRequeridacaracteristica());
    $this->getWidget('valorCaracteristica')->setAttribute('repetible', $caracteristica->getRepetiblecaracteristica());
    $this->getWidget('valorCaracteristica')->setLabel($caracteristica->getDescripcioncaracteristica());
    $this->getWidget('valorCaracteristica')->setDefault($this->getObject()->getValorcaracteristica());

    ##Esto no lo hace el ALLOW_EXTRAS ni el CSRF....
  //  $this->widgetSchema->setNameFormat('documento_caracteristica[%s]');
    $this->validatorSchema->setOption('allow_extra_fields', true);
    $this->disableLocalCSRFProtection();

  }



}
